#
# MakerWinChain.py
#
# Author: Elysia Haight
#

from WinChain import *
from BreakerWinChain import BreakerWinChain
from Popup import *

# This class checks whether or not the maker has won the game.
class MakerWinChain( WinChain ) :

        #Constructor
        def __init__(self):
                self.MAKER_WIN = 2

# Check for maker win condition. Return maker win condition if it is found. Otherwise,
# continue to next condition.
        def handle_request(self, move_stack) :
                if len(move_stack) == 20 :
                    self.popup = Popup()
                    self.popup.win_game_popup(self.MAKER_WIN)
                    return self.MAKER_WIN
                else :
                        chain = BreakerWinChain()
                        return chain.handle_request(move_stack)
